import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { CanaleRuleService } from './canale_rule.service';
import { CreateCanaleRuleDto } from './dto/create-canale_rule.dto';
import { UpdateCanaleRuleDto } from './dto/update-canale_rule.dto';

@Controller('canale-rule')
export class CanaleRuleController {
  constructor(private readonly canaleRuleService: CanaleRuleService) {}

  @Post()
  create(@Body() createCanaleRuleDto: CreateCanaleRuleDto) {
    return this.canaleRuleService.create(createCanaleRuleDto);
  }

  @Get()
  findAll() {
    return this.canaleRuleService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.canaleRuleService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateCanaleRuleDto: UpdateCanaleRuleDto) {
    return this.canaleRuleService.update(+id, updateCanaleRuleDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.canaleRuleService.remove(+id);
  }
}
